package com.baizhi.appController;

import com.baizhi.entity.Article;
import com.baizhi.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RequestMapping("article")
@RestController
public class AppArticleController {

    @Autowired
    private ArticleService articleService;

    @GetMapping("selectArticleByDate/{count}")
    public List<Article> selectArticleByDate(@PathVariable("count") Integer count){
        return articleService.selectArticleByDate(count);
    }
}
